]> git.r.bdr.sh - rbdr/super-polarity/blob - Super Polarity/ScreenManager.cs
I have the worst commits ever.
[rbdr/super-polarity] / Super Polarity / ScreenManager.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
7
8 namespace SuperPolarity
9 {
10 static class ScreenManager
11 {
12 static Stack<Screen> Screens;
13 static SuperPolarity Game;
14
15 static ScreenManager()
16 {
17 Screens = new Stack<Screen>();
18 }
19
20 static public void Push(Screen screen)
21 {
22 Screens.Push(screen);
23 }
24
25 static public void Pop()
26 {
27 Screens.Pop();
28 }
29
30 static public void Update(GameTime gameTime)
31 {
32 Screens.Peek().Update(gameTime);
33 }
34
35 static public void Draw(SpriteBatch spriteBatch)
36 {
37 foreach (Screen screen in Screens)
38 {
39 screen.Draw(spriteBatch);
40 }
41 }
42
43 internal static void SetGame(SuperPolarity game)
44 {
45 Game = game;
46 }
47 }
48 }